//
//  HomeAction.m
//  GuShiNews
//
//  Created by huachun on 2019/8/22.
//  Copyright © 2019 Jones. All rights reserved.
//

#import "HomeAction.h"
#import "HomeInfoController.h"
#import "FabuController.h"

@implementation HomeAction

+(HomeAction *)Actiontodone:(SuperActionType)actiontype view:(id)view dictionary:(NSDictionary *)dictionary{
    HomeAction *action=[[HomeAction alloc] init:actiontype view:view dictionary:dictionary];
    return action;
}

-(instancetype)init:(SuperActionType)actiontype view:(id)view dictionary:(NSDictionary *)dictionary{
    self=[super init];
    if (self) {
        
        self.view = (UIViewController *)view;
        
        if (actiontype == JonesGOTO_Home_Info){
            HomeInfoController *newsinfo=[HomeInfoController new];
            newsinfo.hidesBottomBarWhenPushed = YES;
            if ([dictionary objectForKey:@"model"]) {
                newsinfo.Model = [dictionary objectForKey:@"model"];
            }
            [self.view.navigationController pushViewController:newsinfo animated:YES];
        }
        else if (actiontype == JonesGOTO_Home_Fabu){
            FabuController *newsinfo=[FabuController new];
            newsinfo.hidesBottomBarWhenPushed = YES;
            [self.view.navigationController pushViewController:newsinfo animated:YES];
        }
        else if (actiontype == JonesGOTO_Center){
            
        }
        
    }
    return self;
}


@end
